import allure

from page_element.roncoo_power_manage import power_pe
from page_object.roncoo_login import RoncooLogin
from page_element.el_A3mall import *
import logging
from utils.timer import sleep



class Add_Power(RoncooLogin):
    """添加权限"""

    def page_add_power_login(self, info1,info2,info3):
        # 前置条件：已登录
        self.roncoo_login()
        with allure.step(f"点击权限管理"):
            self.click(power_pe.power_manage)
        with allure.step(f"点击权限管理"):
            self.click(power_pe.power_manage2)
            sleep(2)
        with allure.step(f"点击添加权限"):
            self.click(power_pe.add_power_btn)
            sleep(2)
        with allure.step(f"输入权限名称"):
            self.send_keys(power_pe.power_name,info1)
            sleep(2)
        with allure.step(f"输入权限标识"):
            self.send_keys(power_pe.power_num,info2)
            sleep(2)
        with allure.step(f"输入权限描述"):
            self.send_keys(power_pe.power_desc,info3)
            sleep(2)
        with allure.step(f"点击保存"):
            self.click(power_pe.save_btn)
